<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>

<body>
    <div id="app">
      <!-- 收集select单选,要把v-model写在select上,使用字符串收集 -->
        <h1>请选择你的答案</h1>
        <select v-model="ans">
            <option value="A">A</option>
            <option value="B">B</option>
            <option value="C">C</option>
            <option value="D">D</option>
        </select>

      <!-- 收集select多选,要把v-model写在select上,使用数组收集(收集多个同类型数据) -->

      <h1>请选择你喜欢的学科</h1>
      <select v-model="project" multiple>
            <option value="A">前端</option>
            <option value="B">java</option>
            <option value="C">测试</option>
            <option value="D">产品</option>
            <option value="E">UI</option>
            <option value="F">运维</option>
      </select>
    </div>
    <script>
        Vue.config.productionTip = false;
        
        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    ans:"A",
                    project:[]
                }
            }
        })
</script>
</body>

</html>